/*
 * Model
 *
 *  Created on: 10/06/2011
 *      Author: Agustina I. Stekolschik & Ezequiel Palumbo
 */

#ifndef STRUCTMODEL_H_
#define STRUCTMODEL_H_

#include <CodingLogicProvider.h>
#include <DataInputOutput.h>
#include <vector>

using namespace DataInputOutput;

namespace model{

class AbstractCompressionModel{
public:
	AbstractCompressionModel() {};
	virtual void compress(DataInput* dataInput, BitDataOutput* bitDataOutput)=0;
	virtual void decompress(BitDataInput* bitDataInput, DataOutput* dataOutput, DataUnitFactory* dataUnitFactory)=0;
	virtual ~AbstractCompressionModel() {};
};

class StructModel : public AbstractCompressionModel{
public:
	StructModel(CodingLogicProvider& provider);
	void initContexts();
	void compress(DataInput* dataInput, BitDataOutput* bitDataOutput);
	void decompress(BitDataInput* bitDataInput, DataOutput* dataOutput, DataUnitFactory* dataUnitFactory);
private:
	CodingLogicProvider* codingLogicProvider;
	vector<AbstractContext*> contexts;
};

}
#endif
